<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
 var user = {
     admin: "zhangshan",
     paword: 12345
 }

 var user2 =  Object.create(user)
 //会在原型上创建一样的数据

 console.log(user);
 console.log(user2);


 var user3 = Object.create(user,{
     mobile: {
         value: 110,
         writable: false, //不能修改
         configurable:true, //可以删除
         enumerable: true  //可以迭代
     },
 })
//  var user3 =  Object.create(user3)

 console.log(user3);


 student = {
     school: 'text',
     learn: function(){
         console.log('学习');
     }
 }

 var mintor = Object.create(student,{
     type:{
         value: '班长',
         writable:false,
         configurable:true,
         enumerable:true
     },
     age:{
         value:19,
         writable:false,
         configurable:true,
         enumerable:false
     }
 })

// 设置属性的修改
var mintor = Object.defineProperty(mintor,"type",{
    value:'副班长',
    writable:true,
    configurable:false,
    enumerable:false
})



 console.log(mintor);




</script>


</html>